#version 460 core

layout(rgba32f, binding = 0) uniform image2D radiance_map;
layout(rgba32f, binding = 1) uniform image2D radiance_map_after_haar;
layout(rgba32f, binding = 2) uniform image2D radiance_map_after_sss;
layout(rgba32f, binding = 3) uniform image2D kernel;
layout(rgba32f, binding = 4) uniform image2D world_pos_map;

layout (location = 0) out vec4 FragColor;

uniform int check_binding;
uniform float A;

layout(std430, binding = 0) buffer KernelCoef
{
	vec4 data[];
} kernel_coef;

in vec2 TexCoords;

void main()
{             
	vec4 color;
	switch (check_binding)
	{
		case 0:
			color = imageLoad(radiance_map, ivec2(TexCoords * imageSize(radiance_map)));
			break;
		case 1:
			color = imageLoad(radiance_map_after_haar, ivec2(TexCoords * imageSize(radiance_map_after_haar)));
			break;
		case 2:
			color = imageLoad(radiance_map_after_sss, ivec2(TexCoords * imageSize(radiance_map_after_sss)));
			break;
		case 3:
			color = imageLoad(kernel, ivec2(TexCoords * imageSize(kernel)));
			break;
		case 4:
			color = imageLoad(world_pos_map, ivec2(TexCoords * imageSize(world_pos_map)));
			break;
	}
	// vec4 color = texture(tex, TexCoords);
	// vec4 color = texture(radiance_map_after_wavelet, TexCoords);

	FragColor = color;
}